from PIL import Image, ImageDraw, ImageFont

# 创建画布
img = Image.new('RGB', (600, 400), color='white')
draw = ImageDraw.Draw(img)
font = ImageFont.load_default()

# 绘制平移、旋转和对称变换的结果
draw.text((10, 10), "平移后的坐标: (3.0, 4.0)", fill="black", font=font)
draw.text((10, 50), "旋转后的坐标: (1.0, -1.0)", fill="black", font=font)
draw.text((10, 90), "关于原点的对称点: (-1.0, -1.0)", fill="black", font=font)

# 保存图像
img_path = "geometric_transformations.png"
img.save(img_path)
print(f"图形已保存为 {img_path}")